package top.tony.base.pagenation;

/**
 * Created by Tony_Du on 2015/12/3 0003.
 */
public class ConditionHandler {
    private static final String WHERE=" WHERE ";
    private static final String AND=" AND ";

    private boolean first=true;

    public void append(String condition,StringBuilder selSql,StringBuilder countSql){
        if(first){
            first=false;
            selSql.append(WHERE).append(condition);
            countSql.append(WHERE).append(condition);
        }else{
            selSql.append(AND).append(condition);
            countSql.append(AND).append(condition);
        }
    }
}
